package pme;

public class Min extends Value{
	private double currNum;
 	
	/**
	 * determines the minimum of two Values
	 * 
	 * @param initVal1
	 * @param initVal2
	 */
	public Min(Value initVal1, Value initVal2){
		if (initVal1==null) initVal1= new NullValue();
		if (initVal2==null) initVal2= new NullValue();
		 
		currNum = (initVal1.evaluate() < initVal2.evaluate())?
			 initVal1.evaluate():
		     initVal2.evaluate();
	}
		
	public double evaluate(){
		return currNum;
		}
}
